import request from "./request";

export const configList = (data) => {
  return request.post("/config/list", data);
};

export const userAdd = (data) => {
  return request.post("/user/add", data);
};

export const userDel = (data) => {
  return request.post("/user/del", data);
};

export const userUpdatePassword = (data) => {
  return request.post("/user/update_password", data);
};

export const userUpdate = (data) => {
  return request.post("/user/update", data);
};

export const userDetail = (data) => {
  return request.post("/user/detail", data);
};

export const userList = (data) => {
  return request.post("/user/list", data);
};

/**
 * 登录日志列表
 * @param {*} data
 * @returns
 */
export const loginLogsList = (data) => {
  return request.post("/user/login_logs", data);
};

export const exportLogsList = (data) => {
  return request.post("/user/export_logs", data);
};

/**
 * 组织架构列表
 * @param {*} data
 * @returns
 */
export const departmentsList = (data) => {
  return request.post("/departments/list", data);
};

/**
 * 新增组织架构
 * @param {*} data
 * @returns
 */
export const addDepartment = (data) => {
  return request.post("/departments/add", data);
};

/**
 * 修改组织架构
 * @param {*} data
 * @returns
 */
export const updateDepartment = (data) => {
  return request.post("/departments/update", data);
};

/**
 * 删除组织架构
 * @param {*} data
 * @returns
 */
export const deleteDepartment = (data) => {
  return request.post("/departments/del", data);
};

/**
 * 组织架构权限
 * @param {*} data
 * @returns
 */
export const departmentsPermissions = (data) => {
  return request.post("/departments/permissions", data);
};

/**
 * 角色列表
 * @param {*} data
 * @returns
 */
export const rolesList = (data) => {
  return request.post("/roles/list", data);
};

/**
 * 新增角色
 * @param {*} data
 * @returns
 */
export const addRole = (data) => {
  return request.post("/roles/add", data);
};

/**
 * 修改角色
 * @param {*} data
 * @returns
 */
export const updateRole = (data) => {
  return request.post("/roles/update", data);
};

/**
 * 删除角色
 * @param {*} data
 * @returns
 */
export const deleteRole = (data) => {
  return request.post("/roles/del", data);
};

/**
 * 角色权限
 * @param {*} data
 * @returns
 */
export const rolesPermissions = (data) => {
  return request.post("/roles/permissions", data);
};

/**
 * 街道列表
 * @param {*} data
 * @returns
 */
export const streetsList = (data) => {
  return request.post("/streets/list", data);
};

/**
 * 居委会列表
 * @param {*} data
 * @returns
 */
export const getCommittees = (data) => {
  return request.post("/streets/get_committees", data);
};

/**
 * 运营单位
 * @param {*} data
 * @returns
 */
export const operatorsList = (data) => {
  return request.post("/operators/list", data);
};

export const getMap = (data) => {
  return request.post("/user/get_map", data);
};
